package com.hzq.service.impl;

import com.hzq.dao.DeptMapper;
import com.hzq.dao.UserMapper;
import com.hzq.empty.Dept;
import com.hzq.empty.User;
import com.hzq.service.DeptService;
import com.hzq.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper;

    // 查询所有
    @Override
    public List<Dept> findAll() {
        return this.deptMapper.findAll();
    }

    // 添加部门
    @Override
    public void addDept(Integer deptid, String deptname) {
        this.deptMapper.addDept(deptid,deptname);
    }

    // 根据id查询部门信息
    @Override
    public Dept findDeptById(Integer id) {
        return this.deptMapper.findDeptById(id);
    }

    // 根据id修改部门
    @Override
    public void updateDept(Integer deptid,String deptname) {
        this.deptMapper.updateDept(deptid,deptname);
    }

    // 删除部门
    @Override
    public void delDept(Integer id) {
        this.deptMapper.delDept(id);
    }
}
